using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
using System.Xml.Serialization;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;

namespace AudioStudio
{
    public class SettingWindow : EditorWindow
    {
        enum Platform
        {
            Android,
            iOS,
            Windows,
            Mac,
        }


        AudioSetting Settings;
        string WwiseInstallationPath;

#if UNITY_EDITOR_OSX
        Platform CurrentPlatform = Platform.Mac;
# elif UNITY_EDITOR_WIN
        Platform CurrentPlatform = Platform.Windows;
#endif

        [MenuItem("AudioStudio/Setting")]
        public static void ShowWindow()
        {
            SettingWindow window = EditorWindow.GetWindow(typeof(SettingWindow)) as SettingWindow;
            window.titleContent = new GUIContent("Audio Settings");
            window.Settings = AudioSetting.LoadSettings();
            WwiseSetupWizard.Settings.WwiseProjectPath = window.Settings.FullWwiseProjectPath;
        }

        public string VersionString
        {
            get
            {
                uint temp = AkSoundEngine.GetMajorMinorVersion();
                uint temp2 = AkSoundEngine.GetSubminorBuildVersion();
                string versionString = "Wwise v" + (temp >> 16) + "." + (temp & 0xFFFF);
                if ((temp2 >> 16) != 0)
                {
                    versionString += "." + (temp2 >> 16);
                }

                versionString += " Build " + (temp2 & 0xFFFF) + " Settings.";
                return versionString;
            }
        }

        public AudioSetting.Plugins CurrentPlugin
        {
            get
            {
                return Settings.CurrentPlugin;
            }
            set
            {
                Settings.CurrentPlugin = value;
                AudioSetting.SaveSettings(Settings);
            }
        }

        private void OnGUI()
        {
            //GUILayout.Label(VersionString);
            if (Settings == null)
            {
                titleContent = new GUIContent("Audio Settings");
                Settings = AudioSetting.LoadSettings();
                WwiseSetupWizard.Settings.WwiseProjectPath = Settings.FullWwiseProjectPath;
            }
            DrawWwiseProject();
            DrawWwiseInstallationPath();
            DrawAssetManagement();
            DrawGlobalOperation();
            AkUtilities.IsWwiseProjectAvailable = true;
        }
        
        private void DrawWwiseProject()
        {
            string description;
            string tooltip;

            GUILayout.Label("Wwise Project", EditorStyles.boldLabel);
            GUILayout.BeginHorizontal("box");
            description = "Reload Wwise Project";
            tooltip = "Reload Wwise Project's All Unit after you changed something of the Wwise Project";
            if (GUILayout.Button(new GUIContent(description, tooltip), GUILayout.Width(330)))
            {
                EditorApplication.delayCall += ReloadWwiseProject;
                Repaint();
            }
            EditorGUILayout.SelectableLabel(Settings.WwiseProjectPath, "textfield", GUILayout.Height(17));
            if (GUILayout.Button("...", GUILayout.Width(30)))
            {
                EditorApplication.delayCall += SetupWwiseProjectPath;
                Repaint();
            }

            GUILayout.EndHorizontal();
        }

        private void DrawWwiseInstallationPath()
        {
#if UNITY_EDITOR_OSX
		    string description = "Wwise Application:";
		    string tooltip = "Location of the Wwise Application. This is required to generate the SoundBanks in Unity.";
		    string labelTitle = "Wwise Application";
#else
            string description = "Wwise Windows Installation Path:";
            string tooltip = "Location of the Wwise Windows Installation Path. This is required to generate the SoundBanks in Unity.";
            string labelTitle = "Wwise Windows Installation Path";
#endif

            GUILayout.Label(labelTitle, EditorStyles.boldLabel);

            GUILayout.BeginHorizontal("box");
            GUILayout.Label(new GUIContent(description, tooltip), GUILayout.Width(330));

#if UNITY_EDITOR_OSX
		    WwiseInstallationPath = Settings.WwiseInstallationPathMac;
#else
            WwiseInstallationPath = Settings.WwiseInstallationPathWindows;
#endif

            EditorGUILayout.SelectableLabel(WwiseInstallationPath, "textfield", GUILayout.Height(17));

            if (GUILayout.Button("...", GUILayout.Width(30)))
            {
                EditorApplication.delayCall += SetupWwiseInstallationPath;
                Repaint();
            }

            GUILayout.EndHorizontal();
        }

        private void DrawAssetManagement()
        {
            GUILayout.Label("Asset Management", EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");
            GUILayout.BeginHorizontal();
            string description = "SoundBanks Export Path* (relative to Wwise project file):";
            string tooltip = "Location of the SoundBanks are for the Wwise project export.";
            GUILayout.Label(new GUIContent(description, tooltip), GUILayout.Width(330));
            EditorGUILayout.SelectableLabel(Settings.SoundbankPath, "textfield", GUILayout.Height(17));

            if (GUILayout.Button("...", GUILayout.Width(30)))
            {
                EditorApplication.delayCall += SetupWwiseSoundBanksPath;
                Repaint();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            description = "SoundBanks Load Path* for Editor (relative to StreamingAssets):";
            tooltip = "Location of the SoundBanks are for the game to load banks.";
            GUILayout.Label(new GUIContent(description, tooltip), GUILayout.Width(370));
            if (string.IsNullOrEmpty(Settings.SoundbankPath))
                Settings.SoundbankPath = "GeneratedSoundBanks";
            if (string.IsNullOrEmpty(Settings.EditorSoundbankPath))
                Settings.EditorSoundbankPath = AkBasePathGetter.DefaultBasePath;
            EditorGUILayout.SelectableLabel(Settings.EditorSoundbankPath, "textfield", GUILayout.Height(17));

            if (!Settings.LoadBankFromExportPath)
            {
                if (GUILayout.Button("...", GUILayout.Width(30)))
                {
                    EditorApplication.delayCall += SetupEditorSoundBanksPath;
                    Repaint();
                }
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("LoadBankFromexportPath:");
            bool lbfep = EditorGUILayout.Toggle(Settings.LoadBankFromExportPath);
            if (Settings.LoadBankFromExportPath != lbfep)
            {
                Settings.LoadBankFromExportPath = lbfep;
                if (lbfep)
                    SetBankPathtoExportPath();
                else
                    AudioSetting.SaveSettings(Settings);
                Repaint();
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Audio Apply Button Mode:");
            bool bm = EditorGUILayout.Toggle(Settings.AudioApplyButtonMode);
            if (bm != Settings.AudioApplyButtonMode)
            {
                Settings.AudioApplyButtonMode = bm;
                AudioSetting.SaveSettings(Settings);
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            EditorGUILayout.LabelField("Enable copying of soundbanks at pre-Build step:");
            bool val = EditorGUILayout.Toggle(Settings.CopySoundBanksAsPreBuildStep);
            if (val != Settings.CopySoundBanksAsPreBuildStep)
            {
                Settings.CopySoundBanksAsPreBuildStep = val;
                AudioSetting.SaveSettings(Settings);
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.EndVertical();
        }

        private void DrawGlobalOperation()
        {
            GUILayout.Label("Global Operation", EditorStyles.boldLabel);
            GUILayout.BeginVertical("box");
            if (GUILayout.Button("Create GlobalAudioObject.prefab"))
            {
                EditorApplication.delayCall += CreateGlobalGameObject;
            }

            if (GUILayout.Button("Add Listener to Main Camera"))
            {
                EditorApplication.delayCall += AddListenerToMainCamera;
            }

            if (GUILayout.Button("Disable Unity Audio"))
            {
                EditorApplication.delayCall += DisableUnityAudio;
            }

            if (GUILayout.Button("Generate SoundBanks"))
            {
                EditorApplication.delayCall += GenerateSoundBanks;
            }
            if (GUILayout.Button("Svn add All *.so;*.a;*.dll"))
            {
                EditorApplication.delayCall += SvnAddCommand;
            }
            if (GUILayout.Button("Init Audio"))
            {
                EditorApplication.delayCall += InitAudio;
            }
            if (GUILayout.Button("Reload All Banks"))
            {
                EditorApplication.delayCall += ReloadAllBanks;
            }
            GUILayout.EndVertical();

            //���뵼��Banks
            GUILayout.BeginHorizontal();
            GUILayout.Label("Import Banks or Remove:");
            CurrentPlatform = (Platform)EditorGUILayout.EnumPopup(CurrentPlatform);
            if (GUILayout.Button("Import Banks"))
            {
                EditorApplication.delayCall += ImportPlatformAudioFiles;
            }
            if (GUILayout.Button("Remove Banks"))
            {
                EditorApplication.delayCall += RemovePlatformAudioFiles;
            }
            GUILayout.EndHorizontal();

            //����Debug\Profile\Release
            GUILayout.BeginHorizontal();
            GUILayout.Label("Activate Plugins:");
            AudioSetting.Plugins newPlugin = (AudioSetting.Plugins)EditorGUILayout.EnumPopup(CurrentPlugin);
            if (newPlugin != CurrentPlugin)
            {
                PluginActivator.Update();
                PluginActivator.ActivatePlugins(CurrentPlugin.ToString(), false);
                PluginActivator.ActivatePlugins(newPlugin.ToString(), true);
                CurrentPlugin = newPlugin;
            }
            GUILayout.EndHorizontal();
        }


        private void ReloadWwiseProject()
        {
            WwiseSetupWizard.Settings.WwiseProjectPath = Settings.FullWwiseProjectPath;
            WwiseWWUBuilder.Populate(Settings);
        }

        private void SetupWwiseProjectPath()
        {
            string defaultPath = Path.GetDirectoryName(Path.GetFullPath(Path.Combine(Application.dataPath, Settings.WwiseProjectPath == null ? string.Empty : Settings.WwiseProjectPath)));
            string WwiseProjectPathNew = EditorUtility.OpenFilePanel("Select your Wwise Project", defaultPath, "wproj");
            if (WwiseProjectPathNew.Length != 0)
            {
                if (WwiseProjectPathNew.EndsWith(".wproj") == false)
                {
                    EditorUtility.DisplayDialog("Error", "Please select a valid .wproj file", "Ok");
                }
                else
                {
                    Settings.WwiseProjectPath = AkUtilities.MakeRelativePath(Application.dataPath, WwiseProjectPathNew);
                    AudioSetting.SaveSettings(Settings);
                    WwiseSetupWizard.Settings.WwiseProjectPath = Settings.FullWwiseProjectPath;
                    WwiseWWUBuilder.Populate(Settings);
                }
            }
        }
        private void SetupWwiseInstallationPath()
        {
#if UNITY_EDITOR_OSX
			string installationPathNew = EditorUtility.OpenFilePanel("Select your Wwise application.", "/Applications/", "");
#else
            string installationPathNew = EditorUtility.OpenFolderPanel("Select your Wwise application.", Environment.GetEnvironmentVariable("ProgramFiles(x86)"), "");
#endif

            if (installationPathNew.Length != 0)
            {
                WwiseInstallationPath = Path.GetFullPath(installationPathNew);

#if UNITY_EDITOR_OSX
				Settings.WwiseInstallationPathMac = WwiseInstallationPath;
#else
                Settings.WwiseInstallationPathWindows = WwiseInstallationPath;
#endif
                AudioSetting.SaveSettings(Settings);
            }
        }

        private void SetupWwiseSoundBanksPath()
        {
            string wppath = Path.GetDirectoryName(Settings.WwiseProjectPath);
            string fullPath = AkUtilities.GetFullPath(Application.dataPath, wppath);
            fullPath = AkUtilities.GetFullPath(fullPath, Settings.SoundbankPath);
            string defaultPath = Path.GetDirectoryName(fullPath);
            string SoundbankPathNew = EditorUtility.OpenFolderPanel("Select your SoundBanks destination folder", defaultPath, "");
            if (SoundbankPathNew.Length != 0)
            {
                string WprojPath = AkUtilities.GetFullPath(Application.dataPath, wppath);
                Settings.SoundbankPath = AkUtilities.MakeRelativePath(WprojPath, SoundbankPathNew);
                UpdateSoundbanksDestinationFolders(WprojPath, Settings.SoundbankPath);
                AudioSetting.SaveSettings(Settings);
            }
        }

        private void SetupEditorSoundBanksPath()
        {
            string fullPath = AkUtilities.GetFullPath(Application.streamingAssetsPath, Settings.EditorSoundbankPath);
            string defaultPath = Path.GetDirectoryName(fullPath);
            string SoundbankPathNew = EditorUtility.OpenFolderPanel("Select your SoundBanks destination folder", defaultPath, "");
            if (SoundbankPathNew.Length != 0)
            {
                //string WprojPath = AkUtilities.GetFullPath(Application.streamingAssetsPath, Settings.WwiseProjectPath);
                //fullPath = Path.Combine(Application.streamingAssetsPath, "Audio");
                Settings.EditorSoundbankPath = AkUtilities.MakeRelativePath(Application.streamingAssetsPath, SoundbankPathNew);
                UpdateSoundbanksDestinationFolders(Application.streamingAssetsPath, Settings.EditorSoundbankPath);
                AudioSetting.SaveSettings(Settings);
            }
        }

        private void SetBankPathtoExportPath()
        {
            string WprojPath = AkUtilities.GetFullPath(Application.dataPath, Settings.WwiseProjectPath);
            string defaultPath = Path.GetDirectoryName(WprojPath);
            string fullPath = AkUtilities.GetFullPath(defaultPath, Settings.SoundbankPath);
            defaultPath = Path.Combine(Application.streamingAssetsPath, "Audio");
            Settings.EditorSoundbankPath = AkUtilities.MakeRelativePath(defaultPath, fullPath);
            UpdateSoundbanksDestinationFolders(Application.streamingAssetsPath, Settings.EditorSoundbankPath);
            AudioSetting.SaveSettings(Settings);
        }

        private void InitAudio()
        {
            GameObject gameObj = new GameObject("AudioManager");
            gameObj.AddComponent<AkTerminator>();
            AkInitializer initializer = gameObj.AddComponent<AkInitializer>();
            initializer.InitializationSettings.CallbackManagerInitializationSettings.IsLoggingEnabled = true;
            gameObj.AddComponent<GlobalSoundObj>();
            AudioManager.Instance.Init(gameObj);
            DontDestroyOnLoad(gameObj);
        }

        private void ReloadAllBanks()
        {
            // AkBankManager.ForceUnloadAll();
            // AkSoundEngine.UnloadBank("Init.bnk",IntPtr.Zero);
            // GenerateSoundBanks();
            Debug.Log(GetFullBankPath());
            string[] files = Directory.GetFiles(GetFullBankPath(), "*.prefab", SearchOption.AllDirectories);
            foreach(var i in files)
            {
                Debug.Log(i);
            }
        }

        private void CreateGlobalGameObject()
        {
            string fullPrefab = "Assets/Resources/" + AudioInit.GlobalAudioObjectPrefab + ".prefab";
            if (!File.Exists(fullPrefab))
            {
                GameObject globalAudioObject = new GameObject("GlobalAudioObject");
                globalAudioObject.AddComponent<AkTerminator>();
                AkInitializer initializer = globalAudioObject.AddComponent<AkInitializer>();
                initializer.InitializationSettings.CallbackManagerInitializationSettings.IsLoggingEnabled = true;
                PrefabUtility.CreatePrefab(fullPrefab, globalAudioObject);
            }
        }

        private void AddListenerToMainCamera()
        {
            DefaultAudioListener listener = Camera.main.gameObject.GetComponent<DefaultAudioListener>();
            if (listener != null)
            {
                Component.DestroyImmediate(listener);
            }
            Camera.main.gameObject.AddComponent<DefaultAudioListener>();
        }

        private void DisableUnityAudio()
        {
            SerializedObject audioSettingsAsset = null;
            SerializedProperty disableAudioProperty = null;

            UnityEngine.Object[] assets = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/AudioManager.asset");
            if (assets.Length > 0)
            {
                audioSettingsAsset = new SerializedObject(assets[0]);
            }

            if (audioSettingsAsset != null)
            {
                disableAudioProperty = audioSettingsAsset.FindProperty("m_DisableAudio");
            }

            if (disableAudioProperty == null)
            {
                Debug.Log("ProjectSettings/AudioManager Audio is allready diabled!");
                return;
            }

            disableAudioProperty.boolValue = true;
            audioSettingsAsset.ApplyModifiedProperties();
            Debug.Log("ProjectSettings/AudioManager Audio is diabled!");
        }

        private void GenerateSoundBanks()
        {
            if (BankGenerator.IsSoundbankGenerationAvailable())
            {
                BankGenerator.GenerateSoundbanks();
            }
            else
            {
                string errorMessage;

#if UNITY_EDITOR_WIN
                errorMessage = "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Windows Installation Path from the Edit > Wwise Settings... menu.";
#elif UNITY_EDITOR_OSX
				errorMessage = "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Application from the Edit > Wwise Settings... menu.";
#endif

                AkSoundEngine.LogError(errorMessage);
            }
        }

        private void SvnAddCommand()
        {
#if UNITY_EDITOR_WIN
            string pluginPath = Path.Combine(Application.dataPath, "Plugins/Audio");
            AddToSvn(pluginPath,"so");
            AddToSvn(pluginPath, "a");
            AddToSvn(pluginPath, "dll");
            string arguments = string.Format("/command:commit /path:\"{0}\"", pluginPath);
            RunCommand("TortoiseProc.exe", arguments);
#endif
        }

#if UNITY_EDITOR_WIN
        private void AddToSvn(string pluginPath, string suffix)
        {
            string[] files = Directory.GetFiles(pluginPath, "*." + suffix, SearchOption.AllDirectories);
            string title = "SvnCommit";
            EditorUtility.DisplayCancelableProgressBar(title, "wait...", 0);
            for (var i = 0; i < files.Length; i++)
            {
                string fullPath = Path.GetFullPath(files[i]);
                Debug.Log(fullPath);
                if (EditorUtility.DisplayCancelableProgressBar(title, fullPath, (i + 1) * 1.0f / files.Length))
                {
                    break;
                }

                string arguments = string.Format("/command:add /path:\"{0}\" /closeonend", fullPath);
                RunCommand("TortoiseProc.exe", arguments);
            }
            EditorUtility.ClearProgressBar();
        }
#endif

        private void RunCommand(string cmd,string arguments)
        {
            string output = "";

            System.Diagnostics.Process process = new System.Diagnostics.Process();

            process.StartInfo.FileName = cmd;
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.Arguments = arguments;
            process.Start();

            StreamReader reader = process.StandardOutput;
            output = reader.ReadToEnd();

            process.WaitForExit();
            process.Close();
            Debug.Log(output);
        }

        private string GetFullBankPath()
        {
            return Path.Combine(Application.streamingAssetsPath, AkBasePathGetter.DefaultBasePath);
        }

        private void ImportPlatformAudioFiles()
        {
            string audioDestPath = GetFullBankPath();
            CreateAudioDirectory(audioDestPath);
            CleanDirectory(audioDestPath);
            string WprojPath = AkUtilities.GetFullPath(Application.dataPath, Settings.WwiseProjectPath);
            string audioSrcPath = AkUtilities.GetFullPath(Path.GetDirectoryName(WprojPath), Settings.SoundbankPath);
            CopyAudioFiles(CurrentPlatform.ToString(), "wem", audioSrcPath, audioDestPath);
            CopyAudioFiles(CurrentPlatform.ToString(), "bnk", audioSrcPath, audioDestPath);
        }

        public void ImportPlatformAudioFiles(string platform)
        {
            string audioDestPath = GetFullBankPath();
            CreateAudioDirectory(audioDestPath);
            CleanDirectory(audioDestPath);
            if (Settings == null)
            {
                Settings = AudioSetting.LoadSettings();
            }
            WwiseSetupWizard.Settings.WwiseProjectPath = Settings.FullWwiseProjectPath;
            string WprojPath = AkUtilities.GetFullPath(Application.dataPath, Settings.WwiseProjectPath);
            string audioSrcPath = AkUtilities.GetFullPath(Path.GetDirectoryName(WprojPath), Settings.SoundbankPath);
            CopyAudioFiles(platform, "wem", audioSrcPath, audioDestPath);
            CopyAudioFiles(platform, "bnk", audioSrcPath, audioDestPath);
        }

        private void RemovePlatformAudioFiles()
        {
            string audioDestPath = GetFullBankPath();
            CleanDirectory(audioDestPath);
        }

        private void CopyAudioFiles(string platform, string suffix, string audioPath, string audioDestPath)
        {
            string srcpath = Path.Combine(audioPath,platform);
            string[] files = Directory.GetFiles(srcpath, "*." + suffix, SearchOption.AllDirectories);
            EditorUtility.DisplayCancelableProgressBar(platform, "wait...", 0);
            for (var i = 0; i < files.Length; i++)
            {
                string fullPath = files[i].Replace(@"\", "/");
                string shortpath = fullPath.Substring(srcpath.Length+1);
                if (EditorUtility.DisplayCancelableProgressBar(platform, shortpath, (i + 1) * 1.0f / files.Length))
                {
                    break;
                }
                string dstpath = Path.Combine(audioDestPath,platform);
                string destName = Path.Combine(dstpath, shortpath);
                string destPath = Path.GetDirectoryName(destName);
                CreateAudioDirectory(destPath);
                Debug.Log(string.Format("Copy:{0} to:{1}", fullPath, destName));
                File.Copy(fullPath, destName, true);
            }
            EditorUtility.ClearProgressBar();            
        }

        private void CreateAudioDirectory(string audioDestPath)
        {
            if (Directory.Exists(audioDestPath))
                return;
            string destPath = Path.GetFullPath(audioDestPath);            
            destPath = destPath.Replace(@"\", "/");
            string[] folders = destPath.Split('/');
            string shortPath = Path.GetPathRoot(destPath);
            for (var i = 1; i < folders.Length; i++)
            {
                shortPath = Path.Combine(shortPath, folders[i]);
                if (!Directory.Exists(shortPath))
                {
                    Directory.CreateDirectory(shortPath);
                    Debug.Log("CreateDirectory:" + shortPath);
                }
            }
        }

        private void CleanDirectory(string dir)
        {
            if (!Directory.Exists(dir))
                return;
            Debug.Log("CleanDirectory:" + dir);
            foreach (string d in Directory.GetFileSystemEntries(dir))
            {
                if (File.Exists(d))
                {
                    FileInfo fi = new FileInfo(d);
                    if (fi.Attributes.ToString().IndexOf("ReadOnly") != -1)
                        fi.Attributes = FileAttributes.Normal;
                    Debug.Log("Delete:" + d);
                    File.Delete(d);//ֱ��ɾ�����е��ļ� 
                }
                else
                {
                    CleanDirectory(d);////�ݹ�ɾ�����ļ���
                    Directory.Delete(d);
                }
            }
        }
        
        private void UpdateSoundbanksDestinationFolders(string WwiseProjectPath,string SoundBanksPath)
        {
            try
            {
                if (WwiseProjectPath.Length == 0)
                    return;

                if (!File.Exists(WwiseProjectPath))
                    return;                
                
                XmlDocument doc = new XmlDocument();
                doc.Load(WwiseProjectPath);
                XPathNavigator Navigator = doc.CreateNavigator();

                // Navigate the wproj file (XML format) to where generated soundbank paths are stored
                XPathNodeIterator it = Navigator.Select("//Property[@Name='SoundBankPaths']/ValueList/Value");
                foreach (XPathNavigator node in it)
                {
                    string path = node.Value;
                    AkBasePathGetter.FixSlashes(ref path);
                    string pf = node.GetAttribute("Platform", "");
                    string platformBankPath = Path.Combine(SoundBanksPath, pf);
                    platformBankPath = platformBankPath.Replace("/", @"\");
                    node.SetValue(platformBankPath);
                }
                doc.Save(WwiseProjectPath);
            }
            catch (Exception ex)
            {
                // Error happened, return empty string
                AkSoundEngine.LogError("Wwise: Error while reading project " + WwiseProjectPath + ".  Exception: " + ex.Message);
            }
        }


    }
}